/* **********************************************************
 * Copyright 2010 Dimitar Vangelovski
 *
 * This file is part of the Gens3 3D Engine.
 *
 * The Gens3 3D Engine is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * The Gens3 3D Engine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with the Gens3 3D Engine; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA
 * **********************************************************/


#pragma once

#include <SDL.h>
#include "Scene.h"
#include "Camera.h"
#include "DrawGL.h"

class CApp
{
public:
        CApp();

        int OnExecute();
        bool OnInit();
        void OnEvent(SDL_Event* pEvent);
        void OnRender();
        void OnCleanup();

static  void WriteToLog(const char * pString);

private:
	void CalculateFrameRate();
	// OpenGL specific functions
	void ReshapeGL(int width, int height);
	bool CreateWindowGL(int width, int height);

private:
	CScene *	m_pScene;
	CDrawGL		m_DrawGL;
	CCamera		m_Camera;

	bool	        m_bRunning;
        SDL_Surface *	m_pSurfDisplay;
	SDL_Rect ** 	m_ppDisplayModes;
	Uint8 *	        m_pKeys;
	float 	        m_fFrameInterval;

static  FILE *          m_logFile;
};
